package com.yimi.image;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.yimi.actions.ConnectListener;
import com.yimi.search.AHApplication;

public class LoddingActivity extends Activity implements ConnectListener{
    AHApplication app ;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loading); 
        app = (AHApplication) this.getApplication();
        app.registerConnectListener(this);
        app.startService();
    }

    /* (non-Javadoc)
     * @see com.yimi.actions.ConnectListener#onConnectSuccess()
     */
    @Override
    public void onConnectSuccess() {
        Intent intent1 = new Intent(this, SearchActivity.class);
        startActivity(intent1);
        overridePendingTransition(R.anim.fadein, R.anim.fadeout);
        this.finish(); 
       
    }

    public void onDestroy(){
        app.unRegisterConnectListener(this);
        super.onDestroy();
    }

    
}
